<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller 
{
  public function index(){
    $my = M('my_region')->where ( array('pid'=>0) )->select ();
    $this->assign('my',$my);
    $this->display();
 
}
public function getRegion(){
    $Region=M("my_region");
    $map['pid']=$_REQUEST["pid"];
    $map['grade']=$_REQUEST["grade"];
    $list=$Region->where($map)->select();
    echo json_encode($list);
}
}